function resize() {
  const htmlEl = document.documentElement;
  const rem = htmlEl.clientWidth / 100;
  htmlEl.style.fontSize = rem + "px";
}

resize();

window.addEventListener("resize", resize);
